<template>
	<view class="fixed-bottom">
		<view class="price-num-box">
			<view v-if="showSettlement == -1">
				<view class="p-n">
					<text class="p-n-t">数量:<text class="p-n-n-txt">{{number}}</text></text>
					<text class="p-n-t">总价:<text class="p-n-p-txt">{{amountOrderPrice}}</text></text>
				</view>
				<view class="d-d-f">
					<text class="d-d-t">折扣:<text class="d-d-txt">{{discount}}%</text></text>
					<text class="d-d-t">优惠:<text class="d-d-txt">{{preferential}}</text></text>
				</view>
			</view>
			<view v-if="showSettlement == 1">
				<view class="p-n" >
					<text class="p-n-t">应收:<text class="p-n-p-txt">{{amountOrderPrice}}</text></text>
					<text class="p-n-t pnt-left">优惠:<text class="p-n-p-txt">{{preferential}}</text></text>
				</view>
				<view class="d-d-f">
					<text class="d-d-t">实收:<text class="d-d-txt">{{netReceiVal}}</text></text>
					<text class="d-d-t"><text class="d-d-txt d-d-txt-c" v-if="payTypeTxt != ''">{{payTypeTxt}}</text></text>
				</view>
			</view>
			
		</view>
		<view class="btn-box">
			<view @click="isShowBottom" class="b-delete">{{bottomShow ? '更多...' : '收起>>'}}</view>
			<view class="b-copy b-delete-txt" @click="optionAct(action[0])" v-if="!bottomShow">放弃开单</view>
			<view class="b-delete" @click="optionAct(action[1])" v-show="limitChangePrice" v-if="!bottomShow">整单折扣</view>
			<view class="b-delete" @click="optionAct(action[2])" v-show="limitChangePrice" v-if="!bottomShow">优惠抹零</view>
			<view class="b-delete" @click="optionAct(action[3])">存草稿单</view>
			<view class="b-copyreader" @click="optionAct(action[4])">{{showSettlement == -1 ? "结算" : "完成" }}</view>
		</view>
	</view>
</template>

<script>
	import lang from "../../js/conf/Lang.js";
	import staticConst from "../../js/const/StaticConst.js";
	export default {
			  //数量，    总价         折扣        优惠	
		props:["number",
			   "totalPrice",
			   "discount",
			   "preferential",
			   "showSettlement",
			   "netReceiVal",
			   "payTypeTxt",
			   "amountOrderPrice",
			   "limitChangePrice",
			],
		data() {
			return {
				action:[staticConst.RECEIPT_DEL_ACT,
						staticConst.RECEIPT_DISC_ACT,
						staticConst.RECEIPT_ZERO_ACT,
						staticConst.RECEIPT_DERIFT_ACT,
						staticConst.RECEIPT_SETTLEMENT_ACT],
				bottomShow : true,
			};
		},
		
		methods:{
			isShowBottom()
			{
				this.bottomShow = !this.bottomShow;
			},
			
			optionAct(act)
			{
				this.$emit("optionAct",act);
			}
		}
	}
</script>

<style lang="scss">
	.fixed-bottom
	{
		height: 60px;
		right: 0;
		bottom: 0;
		background: #FFF;
		border-top: 1px solid #ECECEC;
		border-bottom: 1px solid #ECECEC;
		overflow-x: auto;
		z-index: 2;
		font-size: 16px;
		display: flex;
		justify-content: flex-end;
		
		.price-num-box
		{
			position: absolute;
			left: 343px;
			padding-left: 20px;
			// position: relative;
			// width: 40%;
			color: #333;
			.p-n
			{
				.p-n-t
				{
					.p-n-n-txt
					{
						padding-left: 8px;
						padding-right: 16px;
					}
					
					.p-n-p-txt
					{
						color:#F04848 ;
						padding-left: 8px;
					}
				}
				.pnt-left
				{
					padding-left: 16px;
				}
			}
			.d-d-f
			{
				.d-d-t
				{
					.d-d-txt
					{
						color:#00C569 ;
						padding-left: 8px;
						padding-right: 16px;
					}
					
					.d-d-txt-c
					{
						color:#F04848;
					}
				}
			}
		}
		
		.btn-box
		{
			z-index: 998;
			background-color: #fff;
			display: flex;
			.b-copyreader
			{
				cursor: pointer;
				width: 120px;
				height: 60px;
				background: #3388FF;
				color: #FFF;
				text-align: center;
				line-height: 60px;
			}
			
			.b-copyreader:hover
			{
				opacity: .9;
			}
			.b-copyreader:active
			{
				opacity: .8;
			}
			.b-delete, .b-copy
			{
				cursor: pointer;
				width: 80px;
				height: 60px;
				text-align: center;
				line-height: 60px;
				color: #333
			}
			
			.b-delete-txt
			{
				color: #FF0000;
			}
			
			.b-delete:hover, .b-copy:hover
			{
				background-color: #EEE;
			}
			
			.b-copy:active, .b-delete:active, 
			{
				background-color: #DEDEDE;
			}
		}
		
	}
</style>
